import {Component} from 'react';
import './index.less'
import Lazyimg from 'react-lazyimg-component';
import loadingImg from '../../../assets/loading.png'
import WithRouter from '../../../router/withRouter';
class GoodsItem extends Component{
    render(){
        return(
            <div className="goods_item" onClick={()=>{
              this.props.router.navigate('/info/'+this.props.goods.id)
            }}>
            <Lazyimg className="lazy_img" src={this.props.goods.image} placeholder={<img src={loadingImg} alt='加载失败'/>}/>
            <div className="info">
              <div className="name">{this.props.goods.storeName}</div>
              <div className="oldprice">¥{this.props.goods.otPrice}</div>
              <div className="price">¥{this.props.goods.price}</div>
            </div>
          </div>
        )
    }
}
export default WithRouter(GoodsItem);